ULS Log Viewer - Part 1

One of the very basic tools to monitor issues in a SharePoint Farm is the ULS Log Viewer. The Unified Logging Service (ULS) logs in SharePoint 2013 track server-side and client-side activities in the farm. Application life cycle and diagnostics information is captured in these logs. The data gathered in the ULS logs depends on the logging settings, the highest level being the most verbose. The logging settings can be changed from "Central Admin" --> "Monitoring" --> "Configure diagnostics Logging" and chose the level of logging, in other words, Warning, Critical, and Verbose as shown in Figure 1.

ULS -Log-Viewer-1.jpg

Figure  SEQ Figure \* ARABIC 1: Logging Settings

If Verbose log setting is enabled then that is great for debugging but not good for the performance of the SharePoint Farm. After debugging make sure to reset the log settings.

The logs are stored by default in the "..[15]\logs" folder. Your custom full trust solution can also write information to the ULS logs. Since custom solutions require full trust, this cannot be done in the cloud version of SharePoint.

You can use PowerShell to filter the data, display it in various ways, and output the data to a data grid with which you can filter, sort, group, and export data to Excel 2013.

The following PowerShell command opens the log in a filterable, searchable data grid in a separate window as shown in Figure 2.

Get-SPLogEvent | Out-GridView

ULS -Log-Viewer-2.jpg

Figure  SEQ Figure \* ARABIC 2: Example of ULS Log as Grid View

To export grid data to a spreadsheet, select the rows that you want to export. You can select multiple rows by using SHIFT+DRAG to select a block of rows, CTRL+CLICK to select specific rows, or CTRL+A to select all rows. Copy the selected rows and then paste the copied rows into the Excel spreadsheet.

You can also filter and sort the results before you copy the data into a spreadsheet. When you sort or filter data, only the resulting viewable data is copied over.

I've personally found the Stefan's utility very useful, as shown in Figure 3. The only drawback being, you cannot copy the data in Excel for doing further analysis. You can use this ULS Log Viewer available from CodePlex to filter the data, display it in various ways, and output the data to a data grid with which you can filter, sort, group, and export data to Excel 2013.

You can download the viewer from: http://ulsviewer.codeplex.com/

ULS -Log-Viewer-3.jpg
  
 Figure  SEQ Figure \* ARABIC 3: Stefan Gordon's ULS Viewer Snapshot